//
//  AccelerationAppDelegate.h
//  Acceleration
//
//  Created by Chris Whitney on 11/11/08.
//  Copyright __MyCompanyName__ 2008. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Celestial.h"
#import "GraphView.h"
#import "ActivityLevel.h"

@class GraphView;

@interface AccelerationAppDelegate : NSObject <UIApplicationDelegate, UIAccelerometerDelegate> {
    UIWindow *window;
    UIBarButtonItem *filterButton;
    UIBarButtonItem *recordButton;
    
    GraphView *xGraphView;
    GraphView *yGraphView;
    GraphView *zGraphView;

    // Toggle states
    BOOL isRecording;
    BOOL isFiltering;
    
    // Data file
    NSMutableData *data;
    
    // System volume controller
    AVSystemController *volumeControl;
    
    // Current volume level in 0...1
    float currentVolume;
    
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *filterButton;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *recordButton;

@property (nonatomic, retain) IBOutlet GraphView *xGraphView;
@property (nonatomic, retain) IBOutlet GraphView *yGraphView;
@property (nonatomic, retain) IBOutlet GraphView *zGraphView;

@property (nonatomic, retain) NSMutableData *data;
@property (nonatomic, retain) AVSystemController *volumeControl;

-(IBAction)toggleRecord:(id)sender;
-(IBAction)toggleFilter:(id)sender;
-(void)writeData;
-(void)updateVolumeWithActivity:(int)activity;

@end

